package com.spring.le.aspect;

import com.spring.le.model.Address;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class LogAspectXml {
    public void insert(){
        //连接点
    }
    public void before(JoinPoint joinPoint){
        ((Address)joinPoint.getArgs()[0]).setName("通过切面设置");
        System.out.println("切面前的操作");
    }

    public void after(){
        System.out.println("后置操作日志");
    }
    public Object aroundMethod(ProceedingJoinPoint pjp) throws Throwable{
        System.out.println("around start");
        Object res=pjp.proceed();
        System.out.println("around end");
        return res;
    }
    public void error(JoinPoint joinPoint){
        System.out.println("错误处理");
    }
}
